#!/bin/sh

ImageName="kv"
ImageTag="${1}"
if [ -z "${ImageTag}" ]; then
  echo "image tag not specified" && \
  exit 1
fi

cd $(dirname "${0}") && \
go mod tidy && \
go build -ldflags="-s -w" -trimpath -o kv && \
docker build --rm --tag "${ImageName}:${ImageTag}" .
